package com.iflytek.yly.jetpackdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;

import com.iflytek.yly.jetpackdemo.databinding.SimpleTextViewDemo1Activity;
import com.iflytek.yly.jetpackdemo.databinding.SimpleTextViewDemo2Activity;
import com.iflytek.yly.jetpackdemo.databinding.SimpleTextViewDemo3Activity;
import com.iflytek.yly.jetpackdemo.databinding.SimpleTextViewDemo4Activity;
import com.iflytek.yly.jetpackdemo.databinding.SimpleTextViewDemo5Activity;
import com.iflytek.yly.jetpackdemo.databinding.SimpleTextViewDemo6Activity;
import com.iflytek.yly.jetpackdemo.databinding.SimpleTextViewDemo7Activity;
import com.iflytek.yly.jetpackdemo.lifecycle.LifeCycleDemo1Activity;
import com.iflytek.yly.jetpackdemo.lifecycle.LifeCycleDemo2Activity;
import com.iflytek.yly.jetpackdemo.lifecycle.LifeCycleDemo3Activity;
import com.iflytek.yly.jetpackdemo.livedata.FragmentWithLiveDataActivity;
import com.iflytek.yly.jetpackdemo.livedata.TimerWithLiveDataActivity;
import com.iflytek.yly.jetpackdemo.room.RoomStudentActivity;
import com.iflytek.yly.jetpackdemo.viewmodel.TimerActivity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        findViewById(R.id.tv_lc1).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, LifeCycleDemo1Activity.class)));

        findViewById(R.id.tv_lc2).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, LifeCycleDemo2Activity.class)));

        findViewById(R.id.tv_lc3).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, LifeCycleDemo3Activity.class)));

        findViewById(R.id.tv_vm1).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, TimerActivity.class)));

        findViewById(R.id.tv_ld1).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, TimerWithLiveDataActivity.class)));

        findViewById(R.id.tv_ld2).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, FragmentWithLiveDataActivity.class)));

        findViewById(R.id.tv_db1).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, SimpleTextViewDemo1Activity.class)));

        findViewById(R.id.tv_db2).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, SimpleTextViewDemo2Activity.class)));

        findViewById(R.id.tv_db3).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, SimpleTextViewDemo3Activity.class)));

        findViewById(R.id.tv_db4).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, SimpleTextViewDemo4Activity.class)));

        findViewById(R.id.tv_db5).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, SimpleTextViewDemo5Activity.class)));

        findViewById(R.id.tv_db6).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, SimpleTextViewDemo6Activity.class)));

        findViewById(R.id.tv_db7).setOnClickListener(v ->
                startActivity(new Intent(MainActivity.this, SimpleTextViewDemo7Activity.class)));


    }
}